package org.dydl.service.system.impl;

import java.util.Date;

import org.dydl.common.dto.ResponseData;
import org.dydl.common.dto.ResponseMessage;
import org.dydl.dao.system.repository.ISysLogRepository;
import org.dydl.model.system.SysLog;
import org.dydl.service.system.ISysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("sysLogService")
public class SysLogServiceImpl implements ISysLogService {

	@Autowired
	private ISysLogRepository sysLogRepository;

	@Override
	public ResponseMessage save(SysLog sysLog) {
		return new ResponseMessage(true, sysLogRepository.save(sysLog));
	}

	@Override
	public ResponseMessage searchList(int page, int rows, String operatorId, Date beginDate, Date endDate) {
		return new ResponseMessage(true, sysLogRepository.searchList(page, rows, operatorId, beginDate, endDate));
	}

	@Override
	public ResponseMessage getAll() {
		return new ResponseMessage(true, new ResponseData<>(1, 1, 1, 10, sysLogRepository.getAll()));
	}

}
